package com.rayo.accesscontrollercopy.model.db.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.litesuits.orm.db.annotation.Table;
import com.rayo.accesscontrollercopy.config.NetworkConfig;

import java.util.Date;

/**
 * Created by yanghaojie on 16/7/27.
 */
@Table("event_table")
public class EventData extends BaseModel {
    private String lockid;

    private String userid;

    private int event;

    private int type;

    private int postion;

    public int getKeytype() {
        return keytype;
    }

    public void setKeytype(int keytype) {
        this.keytype = keytype;
    }

    public String getKeyfactorynumber() {
        return keyfactorynumber;
    }

    public void setKeyfactorynumber(String keyfactorynumber) {
        this.keyfactorynumber = keyfactorynumber;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    String version;
    private int keytype;

    private String keyfactorynumber;

    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date time;

    public EventData() {
        this.lockid = "0";
        this.userid = "0";
        this.event = 0;
        this.type = 1;
        this.time = new Date();
        this.editime = new Date();
    }

    public EventData(int lock, int user, int event, int type, Date time,int keytype,String keyfactorynumber) {
        this.time = time;
        this.lockid = String.valueOf(lock);
        this.userid = String.valueOf(user);
        this.type = type;
        this.event = event;
        this.keytype = keytype;
        this.keyfactorynumber = keyfactorynumber;
        this.editime = new Date();
    }
    public EventData(int lock, int user, int event, int type, Date time,int postion,int keytype,String keyfactorynumber) {
        this.time = time;
        this.lockid = String.valueOf(lock);
        this.userid = String.valueOf(user);
        this.type = type;
        this.event = event;
        this.editime = new Date();
        this.postion=postion;
    }

    public String getLockid() {
        return lockid;
    }

    public void setLockid(String lockid) {
        this.lockid = lockid;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public int getEvent() {
        return event;
    }

    public void setEvent(int event) {
        this.event = event;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getPostion() {
        return postion;
    }

    public void setPostion(int postion) {
        this.postion = postion;
    }
}
